package PRUEBAS;
import java.math.BigDecimal;

public class BigdecimalPrecisionTest {

	public static void main(String args[]) {

//		BigDecimal honey = new BigDecimal("12"), storm = new BigDecimal(0000);
//		
//		System.out.println( "honey object value :" + " " + honey );
//		System.out.println( "precision : " + honey.precision() );
//
//		System.out.println( "\nstorm object value" + " : " + storm );
//		System.out.println( "precision : " + storm.precision() );
//
//		honey = new BigDecimal(-2321);
//		storm = new BigDecimal(-5.1);
//
//		System.out.println( "\nhoney object value " + ": " + honey );
//		System.out.println( "precision : " + honey.precision() );
//		
//		System.out.println( "\nstorm object value " + ": " + storm );
//		System.out.println( "precision : " + storm.precision() );
//
//		storm = new BigDecimal( -5.1 );
//		storm = new BigDecimal( storm.floatValue() );
//		System.out.println( "\nstorm object value " + ": " + storm );
//		System.out.println( "precision : " + storm.precision() );
		
		BigDecimal bd = new BigDecimal("10000.0000");
		System.out.println( "scale1 : " + bd.scale() );
		System.out.println( "precision : " + bd.precision() );
		
		bd = bd.setScale( 9 );
		System.out.println( "scale2 : " + bd.scale() );
		System.out.println( "precision : " + bd.precision() );
		
		bd = bd.setScale( 2 );
		System.out.println( "scale3 : " + bd.scale() );
		System.out.println( "precision : " + bd.precision() );
	}
}